{% extends "base.html" %}

{% block title %}Welcome{% endblock %}

{% block content_header %}Welcome{% endblock %}

{% block main_content %}
<h3>Latest snippets posted:</h3>
<ul>
{% for snippet in latest %}
<li><a href="{{ snippet.get_absolute_url }}">{{ snippet.title }}</a> (<a href="{{ snippet.language.get_absolute_url }}">{{ snippet.language.name }}</a>) by <a href="/users/{{ snippet.author.username }}/">{{ snippet.author.username }}</a> {{ snippet.pub_date|timesince }} ago</li>
{% endfor %}
</ul>

{% load popular %}
{% get_top_rated 5 as top_rated %}
<h3>Top-rated snippets:</h3>
<ol>
{% for snippet in top_rated %}
<li><a href="{{ snippet.get_absolute_url }}">{{ snippet.title }}</a> (<a href="{{ snippet.language.get_absolute_url }}">{{ snippet.language.name }}</a>) by <a href="/users/{{ snippet.author.username }}/">{{ snippet.author.username }}</a></li>
{% endfor %}
</ol>

<h3>Top users:</h3>
{% get_top_authors 5 as top_authors %}
<ol>
{% for author in top_authors %}
<li><a href="/users/{{ author.username }}/">{{ author.username }}</a></li>
{% endfor %}
</ol>
{% endblock %}

{% block sidebar %}
<p>Welcome to <a href="http://www.djangosnippets.org/">Djangosnippets.org</a>, a site for users of the <a href="http://www.djangoproject.com/">Django web framework</a> to come together and share useful "snippets" of reusable code.</p>

<p>If you're just here to browse, you can look through snippets organized <a href="/users/">by author</a>, <a href="/languages/">by language</a> or <a href="/tags/">by tag</a>. You can also have a look at the <a href="/popular/rated/">top-rated snippets</a> and the <a href="/popular/bookmarked/">most-bookmarked snippets</a>.</p>

<p>If you'd like to contribute, <a href="/accounts/register/">sign up for a free account</a> and you'll be able to post snippets of your own, rate and bookmark snippets, and post comments. If you've got any questions, have a look at our <a href="/about/faq/">FAQ</a>.</p>

<p><a rel="alternate" href="/feeds/latest/" type="application/atom+xml"><img src="http://media.djangosnippets.org/img/feed-icon-10x10.png" alt="" /> Feed of latest snippets</a></p>
{% endblock %}